<%@ page import="java.util.List" %>
<%@ page import="com.entity.productdetails" %>
<%@ page import="com.dao.searchdao" %>
<%@ page import="com.dao.searchdaoimpl" %>
<%@ page import="com.entity.game" %>
<%@ page import="com.dao.UserInfDao" %>
<%@ page import="java.util.ArrayList" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<html>
<head>
    <title>租号狗</title>
    <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1"/>
    <meta name="renderer" content="webkit"/>
    <link type="text/css" rel="stylesheet" href="https://static.zhanghaodaren.cn/zhdrpc/common/common.css"/>
    <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
    <meta name="renderer" content="webkit" />

    <meta name="keywords" content="租号狗" />
    <meta name="description" content="租号狗" />
    <link type="text/css" rel="stylesheet" href="https://static.zhanghaodaren.cn/zhdrpc/css/order.css" />
    <link rel="shortcut icon" href="../favicon.ico" />
</head>
<body>
<!-- 通用Js库 Start -->
<script type="text/javascript" src="https://static.zhanghaodaren.cn/zhdrpc/common/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="https://static.zhanghaodaren.cn/zhdrpc/common/common.js"></script>
<!-- 通用Js库 End -->
<!-- 通用顶部 Start -->
<div class="top-common-box">
    <div class="top-common">
        <div class="top-common-left">
            <a href="#">您好，欢迎来到租号狗！</a>
        </div>
        <%
            searchdao sss =new searchdaoimpl();
            String id=sss.searchcookie(request);
            System.out.println("idd="+id);
            if(id=="")
            {
        %>
        <div class="top-common-right">
            <ul>
                <li class="line"><a href="grzhuye.jsp">个人中心</a></li>
            </ul>
        </div>
        <%
        }
        else
        {
        %>
        <div class="top-common-right">
            <ul>
                <li class="line"><a href="grzhuye.jsp">个人中心</a></li>
            </ul>
        </div>
        <%
            }
        %>
    </div>
</div>
<script type="text/javascript" src="../zhdrpc/common/qiYu.js"></script>
<!-- 通用顶部 End -->
<div class="header-box new-header">
    <div class="header clearfix">
        <h1 class="logo">
            <a href="/" title="租号狗">
                <img src="../image/385_385/6BEDBDAD244556EFFC477D864327769F.jpg" alt="LOGO">
                <em>租号狗</em>
            </a>
        </h1>
        <form id="searchForm" method="post" action="/zuhao">
            <div id="mainSearch" class="main-search-box m-search">
                <div class="main-search-top">
                    <div class="main-search-input">
                        <input type="text" id="seaWords" value="" placeholder="请输入关键词为您查找">
                    </div>
                    <div class="main-search-button">
                        <a href="javascript:void(0)" id="seaGamebtn">搜 索</a>
                    </div>
                </div>
            </div>
        </form>
    </div>
</div>
<script type="text/javascript">
    var staticResourceURL = 'https://static.zhanghaodaren.cn/zhdrpc';
    var merchantQq = '';
    var qqLink = 'https://qiyukf.com/client?k=a2c587490ed80490f9097c01191beb40';
    var wangwang = ' ';
    var domain = 'zuhaogu.zhanghaodaren.cn';
    var showAccountLogin = 'false';
    var cotenantType = '1';
</script>
<script type="text/javascript" src="https://static.zhanghaodaren.cn/zhdrpc/common/popup/popup.js"></script>
<script type="text/javascript" src="https://static.zhanghaodaren.cn/zhdrpc/js/main-search.js"></script>
<script type="text/javascript" src="../zhdrpc/common/search_v2.js"></script>
<script type="text/javascript" src="/static/scripts/common/float-menu.js"></script>
<!-- 通用导航 Start -->
<div class="nav">
    <ul class="w1200 clearfix">
        <li class="navlong"><a href="zhuye.jsp" >首页</a></li>
        <li><a href="zuhaodating.jsp" >租号大厅</a></li>
        <li><a href="maihao.jsp" >闲置账号赚钱</a></li>
        <li><a href="grzhuye.jsp" >个人中心</a></li>
    </ul>
</div>
<!-- 通用导航 End -->

<script type="text/javascript" src="https://static.zhanghaodaren.cn/zhdrpc/common/popup/popup.js"></script>
<script type="text/javascript" src="https://static.zhanghaodaren.cn/zhdrpc/common/md5.js"></script>
<script type="text/javascript" src="https://static.zhanghaodaren.cn/zhdrpc/common/Validform-v5.3.2.min.js"></script>
<script type="text/javascript" src="../zhdrpc/common/random.js"></script>
<script type="text/javascript" src="../zhdrpc/common/cooperate.js"></script><!-- 主体区域 Start -->
<%
    String s1="";
    List<productdetails> list=(List<productdetails>) request.getAttribute("zf");
    for (int i = 0; i < list.size(); i++) {
        s1=s1.concat(list.get(i).getPDID());
    }
    searchdao s=new searchdaoimpl();
    String name=s.searchname(s1);
    String s2=s.searchfname(s1);
%>

<div class="main-box">
    <div class="main">
        <div class="order-box goods-detail">
            <div class="goods-info">
                <h2><%=list.get(0).getTitle()%></h2>
                    <div class="goods-info-list">
                        <ul class="clearfix">
                            <li><span>类型：</span><em><%=s2%></em></li>
                            <li><span>名称：</span><em><%=name%></em></li>
                            <li><span>区服：</span><em><%=list.get(0).getZone()%></em></li>
                        </ul>
                    </div>
                    <div class="corner-mark"></div>
            </div>
            <div class="purchase-info">
                <div class="rent-type">
                    <input id="rent-type-input" type="hidden" value="10"/>
                    <ul class="clearfix">
                        <li class="on" data-id="10" onclick="qiehuan1()" id="one">
                            <a href="#"><div class="rent-type-bg"></div><h2><span>时租</span></h2><p id="six" style="display: inline-block"><%=list.get(0).getUnitPrice()%></p><p style="display: inline-block">元/小时</p></a>
                        </li>
                        <li  class="last" data-id="20" onclick="qiehuan2()" id="two">
                            <a href="#"><div class="rent-type-bg"></div><h2><span>包天</span></h2><p id="seven" style="display: inline-block"><%=(20*(Double.parseDouble(list.get(0).getUnitPrice())))%></p><p style="display: inline-block">元/天</p></a>
                        </li>
                        <li class="last"  data-id="40" onclick="qiehuan3()" id="three">
                            <a href="#"><div class="rent-type-bg"></div><h2><span>包周</span></h2><p id="nine" style="display: inline-block"><%=(100*(Double.parseDouble(list.get(0).getUnitPrice())))%></p><p style="display: inline-block">元/周</p></a>
                        </li>
                    </ul>
                </div>
                <script>
                    function ljzy() {
                        var cookieName="dlid";var cookieValue="";
                        try
                        {
                            cookieValue=document.cookie.match(new RegExp("(^|)"+cookieName+"=([^;]*)(;|$)"))[2];
                        }catch (e) {
                            cookieValue=null;
                        }
                        if(cookieValue!=="")
                        {
                            return true
                        }
                        else
                        {
                            alert("请先进行登录")
                            return false
                        }
                    }
                </script>
                <form action="fukuan" method="post" id="fform" onsubmit="ljzy()">
                <div class="form-box">
                    <div class="common-form">
                        <div class="form-item rent-duration  mar-b35 clearfix">
                            <div class="form-item-l"><span>租号时长：</span></div>
                            <div class="form-item-r">
                                <div class="sub-input-plus">
                                    <span class="btn-num btn-l unusable" id="subtract" onclick="qiehuan4()"><em class="vertical"></em></span>
                                    <input type="text" data-min="1" data-max="48" id="rent-num-input" value="1" readonly="readonly" name="time"/>
                                    <span class="btn-num btn-r" id="summation" onclick="qiehuan5()"><em class="transverse"></em><em class="vertical"></em></span>
                                </div>
                                <span class="num-unit"><input type="button" style="background-color: white;border: none" value="小时" id="four"></span>
                                <%--                                <input type="button" style="background-color: white;border: none" value="qiehuan4()">--%>
                            </div>
                        </div>
                        <div class="form-item clearfix">
                            <div class="form-item-l"><span>所需租金：</span></div>
                            <div class="form-item-r"><span class="rent-price price">￥<input type="button" style="background-color: white;border: none" value="<%=list.get(0).getUnitPrice()%>" id="five"></span></div>
                        </div>
                        <div class="form-item mar-b35 clearfix">
                            <div class="form-item-l"><span>租号押金：</span></div>
                            <div class="form-item-r"><span class="price">￥<%=list.get(0).getDeposit()%></span><span class="form-item-tips">（注：押金在订单完成后24小时内退回余额账户）</span></span?></div>
                        </div>
                    </div>
                </div>
                <div class="settle-accounts clearfix">
                    <div class="pay-box">
                        <div class="pay-money">
                            <lable>订单金额：</lable>
                            <span  class="price total-amount">￥<input type="text" style="background-color: white;border: none" value="<%=Double.parseDouble(list.get(0).getUnitPrice())+Double.parseDouble(list.get(0).getDeposit())%>" id="ten" name="tprice" readonly="readonly"></span>
                        </div>
                        <div class="action pay-btn">
                            <input type="button"  value="立即付款" id="fukuan" onclick="fuqian()">
                        </div>
                        <div class="protocol">
                            <input type="checkbox" checked="checked" id="platformAgree">我已阅读并同意<span>《租号平台用户服务协议》</span>
                        </div>
                    </div>
                </div>
                </form>
                <script>
                    var s1=document.getElementById("one");
                    var s2=document.getElementById("two");
                    var s3=document.getElementById("three");
                    var s4='小时';var s5='天';var s6='周';
                    var s7=document.getElementById("four");
                    var s8=document.getElementById("rent-num-input").value;
                    var s9=document.getElementById("five");//*
                    var s10=s8;
                    var s11=document.getElementById("six");
                    var s12=document.getElementById("seven");
                    var s13=document.getElementById("nine");
                    var s14=document.getElementById("ten");//*

                    function getuid() {
                        var cookieName="dlid";var cookieValue="";
                        try
                        {
                            cookieValue=document.cookie.match(new RegExp("(^|)"+cookieName+"=([^;]*)(;|$)"))[2];
                        }catch (e) {
                            cookieValue=null;
                        }
                        return cookieValue;
                    }

                    function qiehuan1() {
                        document.cookie="shijian=one";
                        if(s1.className === "on")
                        {s1.className="last";s7.value=s4}
                        else if(s1.className==="last")
                        {s1.className="on";s2.className="last";s3.className="last";s7.value=s4}
                        s9.value = (s11.innerText) * s10;s14.value=parseFloat(s9.value)+<%=Double.parseDouble(list.get(0).getDeposit())%>
                    }
                    function qiehuan2() {
                        document.cookie="shijian=two";
                        if(s2.className === "on")
                        {s2.className="last";s7.value=s5}
                        else if(s2.className==="last")
                        {s2.className="on";s1.className="last";s3.className="last";s7.value=s5}
                        s9.value = s10 * (s12.innerText);s14.value=parseFloat(s9.value)+<%=Double.parseDouble(list.get(0).getDeposit())%>
                    }
                    function qiehuan3() {
                        document.cookie="shijian=three";
                        if(s3.className === "on")
                        {s3.className="last";s7.value=s6}
                        else if(s3.className==="last")
                        {s3.className="on";s2.className="last";s1.className="last";s7.value=s6}
                        s9.value = (s13.innerText) * s10;s14.value=parseFloat(s9.value)+<%=Double.parseDouble(list.get(0).getDeposit())%>
                    }
                    function qiehuan4() {
                        if(parseFloat(s10)>1) {
                            s10 = parseFloat(s10) - 1;
                            if (s7.value === s4) {s9.value = (s11.innerText) * s10;s14.value=parseFloat(s9.value)+<%=Double.parseDouble(list.get(0).getDeposit())%>
                            } else if (s7.value === s5) {s9.value = s10 * (s12.innerText);s14.value=parseFloat(s9.value)+<%=Double.parseDouble(list.get(0).getDeposit())%>
                            } else if (s7.value === s6) {s9.value = (s13.innerText) * s10;s14.value=parseFloat(s9.value)+<%=Double.parseDouble(list.get(0).getDeposit())%>}
                        }
                    }
                    function qiehuan5() {
                        if(parseFloat(s10)<48) {
                            s10 = parseFloat(s10) + 1;
                            if (s7.value === s4) {s9.value = (s11.innerText) * s10;s14.value=parseFloat(s9.value)+<%=Double.parseDouble(list.get(0).getDeposit())%>
                            } else if (s7.value === s5) {s9.value = s10 * (s12.innerText);s14.value=parseFloat(s9.value)+<%=Double.parseDouble(list.get(0).getDeposit())%>
                            } else if (s7.value === s6) {s9.value = (s13.innerText) * s10;s14.value=parseFloat(s9.value)+<%=Double.parseDouble(list.get(0).getDeposit())%>}
                        }
                    }
                </script>
                <script>
                    function fuqian() {
                        var dlid = getuid();
                        var s = parseFloat($("#ten").attr("value"))
                        if (s <<%=Double.parseDouble(s.searchmoney(s.searchcookie(request)))%>) {
                            if (dlid != null) {
                                <%
                            String gmaster=s.searchUser(list.get(0).getPDID());
                            request.getSession().setAttribute("user",gmaster);
                            request.getSession().setAttribute("pid",list.get(0).getProductID());
                            %>
                                document.getElementById("fform").submit();
                            } else {
                                alert("请先进行登录")
                            }
                        }else {
                            alert("您的余额不足，请先充值")
                        }
                    }
                </script>
            </div>
        </div>
    </div>
</div>
<input type="hidden" id="rechargeBeforeConsume" value="">
<!-- 主体区域 End -->

<!-- 错误弹窗 -->
<div class="order-pop-box error-msg">
    <h5 class="tit clearfix"><span>提示</span>
        <a href="javascript:layer.closeAll()" class="accountSet-close"><em class="iconfont">&#xe63e;</em></a>
    </h5>
    <p>您的余额不足，点击“确定”去充值</p>
    <a href="javascript:void(0)" class="affirm">确 定</a>
</div>

<!-- 设置支付密码 -->
<a href="/userPassword/setPayPassword" target="_blank" style="display: none;" class="setPayPassword"></a>

<!-- 充值 -->
<a href="/recharge" target="_blank" style="display: none;" class="recharge"></a>

<!-- 可选Js库 Start -->
<script type="text/javascript" src="https://static.zhanghaodaren.cn/zhdrpc/common/Validform-v5.3.2.min.js"></script>
<script type="text/javascript" src="https://static.zhanghaodaren.cn/zhdrpc/common/datepicker/WdatePicker.js"></script>
<script type="text/javascript" src="/static/scripts/order/buyFlow.js"></script>
<script type="text/javascript" src="https://static.zhanghaodaren.cn/zhdrpc/common/md5.js"></script>
<div class="footer">
    <div class="footer-01">
        <div class="footer-server-box">
            <div class="footer-server">
                <div class="footer-server-dl">
                    <dl>
                        <dt><img src="https://static.zhanghaodaren.cn/zhdrpc/images/img/footer-img01.png" alt="" /></dt>
                        <dd><h2>省心交易 快捷上号</h2></dd>
                    </dl>
                    <dl>
                        <dt><img src="https://static.zhanghaodaren.cn/zhdrpc/images/img/footer-img02.png" alt="" /></dt>
                        <dd><h2>7*24小时 专属客服</h2></dd>
                    </dl>
                    <dl>
                        <dt><img src="https://static.zhanghaodaren.cn/zhdrpc/images/img/footer-img03.png" alt="" /></dt>
                        <dd>
                            <h2>优质服务 安全可靠</h2>
                        </dd>
                    </dl>
                </div>
            </div>
        </div>
    </div>
    <script>
        var _hmt = _hmt || [];
        (function() {
            var hm = document.createElement("script");
            hm.src = "https://hm.baidu.com/hm.js?a267eac679d353feef3ec01ab62aa94d";
            var s = document.getElementsByTagName("script")[0];
            s.parentNode.insertBefore(hm, s);
        })();
    </script>
    <script type="text/javascript" src="../zhdrpc/common/qiYu.js"></script>
    <script type="text/javascript">
        var _hmt = _hmt || [];
        (function() {
            var hm = document.createElement("script");
            hm.src = "//hm.baidu.com/hm.js?64dcdabba4b3b0c4da826efe00a47636";
            var s = document.getElementsByTagName("script")[0];
            s.parentNode.insertBefore(hm, s);
        })();
    </script>
</div>
</body>
</html>